package au.com.ecaporali.module1.introexercises.triangle;

/**
 * Created by Enrico on 7/09/2014.
 */
public class TriangleExercise {

    private static final String STAR = "*";

    public void easiestEver(){
        print(this.STAR+"\n");
    }

    public void horizontalLine(int number){
        for(int i = 0; i < number; i++ ){
            print(this.STAR);
        }
        print("\n");
    }

    public void verticalLine(int number){
        for(int i = 0; i < number; i++ ){
            print(this.STAR+"\n");
        }
    }

    public void rightTriangle(int number){

        StringBuffer sb = new StringBuffer();

        for(int i = 0; i < number; i++ ){
            sb.append(this.STAR);
            print(sb.toString()+"\n");
        }
    }

    private void print(String s){
        System.out.print(s);
    }
}
